<meta charset="utf-8">
<?php
require_once("tools.php");

$con = new con_db();

if (isset($_POST['idloginright']))
    $sql = "UPDATE persons SET loginright = '$_POST[value]' 
			WHERE zhanghao = '$_POST[idloginright]'";
else {
    $sql = "UPDATE persons SET admin = '$_POST[value]' 
    		WHERE zhanghao = '$_POST[idadmin]'";
}

$con->query($sql);

$url = "admin.php";
header('location:' . $url);
?>